This invention relates generally to adding functionality to application programs executing in a computer system under a graphical user interface and specifically to adding functionality by simulating user commands and issuing system program commands causing a clipboard utility to transfer information to and from an application program.
Personal computers are used to perform such popular tasks as word processing, database management, spreadsheet calculations, etc. The application programs that perform these tasks are large and complex and offer many versatile functions for the user. However, as is inevitably the case, improvements in the programs, changes in the needs of the user or changes in hardware or operating system software invite the addition of new functional features to the application programs. Additionally, it is advantageous if specific added functions can be provided to two or more application programs operating on the same computer system as this conserves memory use.
A typical way to add new features to an application program is for the original manufacturer to come up with a new release of the software. However, this is often costly and burdensome to the user since the entire application program must be reinstalled in place of the older version. Further, this route is not open to third party software developers who wish to create features for an existing application program that would enhance the usefulness of the application program.
The prior art provides "add on" functionality to existing application programs by using "terminate and stay resident" (TSR) programs. A TSR program is loaded into memory and generally remains there while the application program is executed. The TSR program is inactive until a "hot key" is pressed by the user to invoke the TSR program. Once activated, the TSR program can perform its unique useful function.
An example of a TSR program is known in Europe under the name WAYS and runs on International Business Machines (IBM) compatible personal computers. WAYS observes and interprets screen and keyboard activities taking place in the computer and automatically intervenes to perform its added functions upon the occurrence of certain conditions. The main function of WAYS is to provide automatic spelling correction during the execution of an application program such as a word processing program. If a user mistypes a word, WAYS detects the error and corrects the spelling of the word automatically. WAYS determines when a word has been completely typed in by detecting "whitespace" characters such as a space, tab or carriage return before and after a sequence of characters.
Once a completed word is detected, the spelling of the word is checked instantly against a dictionary database as the user continues typing. If the word is spelled incorrectly, WAYS simulates an appropriate number of backspace keypresses to move the cursor to an insertion point and simulates further keypresses to complete the correct spelling of the word. WAYS is able to do this, in part, because it operates under the Microsoft Disk Operating System (MS-DOS) which allows characters on the screen to be easily read during the execution of an application program. That is, application programs in the MS-DOS environment typically write to the screen in a predefined character graphics mode so that a character on the screen is represented as a value in a location in a memory buffer. Since the character values and memory buffer locations are known and do not change from application program to application program, it is relatively easy to design a TSR that can successfully perform functions based on keystrokes and displayed characters.
A problem arises when modern operating systems using graphical user interfaces (GUIs) are used. Such operating systems, like WINDOWS sold by Microsoft Corp., use bit-mapped graphics rather than the character graphics used in text oriented MS-DOS application programs. Unlike character graphics, bit-mapped graphics do not provide a one-to-one relationship between characters on the display screen and memory locations in the computer system. Thus, it is very difficult, if not impossible, for a program that is external to the application program to be able to detect and identify objects displayed on the screen, such as characters in a word processing program.
A second problem in creating add-on functionality to existing application problems in an operating system that uses a GUI is that user input is not, for the most part, via the keyboard. Rather, a user in a GUI uses a mouse to control a pointer to manipulate menus and windows. This presents a problem in providing the user with uniform and efficient ways to invoke the added functions while still preserving the application program's original functionality and making the overall performance transparent to the application program.